![]() |
Working With Lists - Continued |
OPENING QUESTIONS: None Today - We'll discuss lockdown procedures LEARNING TARGET: ROOKIES: I will be able to complete a brief program that allows a user to add a name to an existing list. I will begin working on adding code to that program that allows a user to see if a word exists in a list, and if it does, prompts the user to delete (or NOT!) that word from the list. SENSEIS: I will finish working on a program that allows my user to add, delete or check to see if a word exists in a list. I will begin working on an option to that program that allows a user to select whether they want the list sorted alphabetically from A - Z or from Z to A. WORK O' THE DAY: ═══════════════════════════
═══════════════════════════ HERE is the code for the basic planet list Be sure and make a copy of that AND Save it. Now please use Code A as a basis for writing a program that allows a user to type a planet, check to see if it is there and then either:
there is a quicker and easier way to do that, but I want you to practice 'iterating' which is to say 'stepping' through the list with code and examining each element of that array in turn. Senseis: Please work on asking your user to enter a planet name. Prompt them to enter a planet until all 8 planet names are successfully entered. Duplicates are not allowed. That means that Mars, MARS, mars are not allowed. Only one entry for any form of Mars is allowed. Once all 8 planet names are entered, then prompt the user if they want to quit or if they want to sort the list the list from A - Z or sort the list from Z - A. |